Xbasic

OBJECT.LOCATE_PREV Function

Syntax

.Locate_Prev(C value[, C fieldname])

Arguments

value

The value to find in a field.

fieldname

Optional. Default = all fields. The name of the field to search.

Description

Finds the previous record that matches the value to find.

If you are searching in an indexed field, the <OBJECT>.FIND() method is faster.

The <OBJECT>.LOCATE_PREV() method applies to:

Browses (for <OBJECT> use either the <BROWSE> pointer or the name of the browse)
Forms (for <OBJECT> use either the <FORM> pointer or the name of the form)

The <OBJECT>.LOCATE_PREV() method finds the previous record with a field value matching value. Searches all fields unless Fieldname is specified.

Example

A form has a control called "Find_What" and a button called "Search". When the user presses this button, this script searches for the value in "Find_What". All fields in the record are searched.

Parentform.locate_prev(find_what.value)

Limitations

Desktop applications only.

See Also